<!DOCTYPE html>
<html lang="zh-CN">
    <head>
        <meta charset="UTF-8" />
        <title>14_案例练习-1到10的累加和</title>
    </head>
    <body>
        <script>

            var sum = 0;
            // 输出1到10的每一个数字
            for(var i = 1; i <= 10; i++){
                // sum = sum + i;
                sum += i;
            }

            console.log(sum);
        </script>
    </body>
</html>